// 封装详情页相关接口
import request from '@/utils/request.js'

// 获取景点详情信息
export const getSceneryDetailService = (id) => {
	return request({
		url: `/scenery/detail/${id}`,
		method: 'GET'
	})
}

// 获取酒店详情信息
export const getHotelDetailService = (id) => {
	return request({
		url: `/hotel/detail/${id}`,
		method: 'GET'
	})
}

// 获取餐厅详情信息
export const getRestaurantDetailService = (id) => {
	return request({
		url: `/restaurant/detail/${id}`,
		method: 'GET'
	})
}

// 获取攻略详情信息
export const getPostDetailService = (id) => {
	return request({
		url: `/post/detail/${id}`,
		method: 'GET'
	})
}

// 添加/取消收藏
export const addCollectService = (data) => {
	return request({
		url: '/collection',
		method: 'POST',
		data
	})
}

// 查询收藏状态
export const queryISCollectedService = ({
	type,
	user_id,
	association_id
}) => {
	return request({
		url: '/collection/is_collected',
		method: 'GET',
		params: {
			user_id,
			association_id,
			type
		}
	})
}